package com.spzx.channel.service.impl;

import com.spzx.channel.service.CategoryService;
import com.spzx.common.core.domain.R;
import com.spzx.product.api.RemoteCategoryService;
import com.spzx.product.api.domain.Category;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CategoryServiceImpl implements CategoryService {
    @Resource
    RemoteCategoryService remoteCategoryService;
    @Override
    public List<Category> selectCategoryTree() {
        // 远程访问product服务 查询分类嵌套集合
        R<List<Category>> listR  = remoteCategoryService.listCateTree();
        if (listR.getCode()!=200){
            return null;

        }

        return listR.getData();
    }
}
